package com.project.controller.manager;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.project.bean.OrderBean;
import com.project.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@RestController
@RequestMapping("manager/order")
public class ManagerOrderController {
    @Autowired
    private IOrderService service;

    @RequestMapping("findByItem")
    public IPage<OrderBean> findByItem(int pageNO, String status, LocalDate startDate, LocalDate endDate){
        if (status.equals("不限")){
            status = "";
        }
        return service.findByItems(pageNO, status, startDate, endDate);
    }
    @RequestMapping("findById")
    public OrderBean findById(Integer orderId){
        return service.findById(orderId);
    }
}
